package refparam;

import java.util.Random;

public class Player {
	public String name;
	public int blood;
	
	public void beatMonster(Monster m) {
		System.out.println(name + "玩家发起进攻");
		Random rand = new Random();
		// 攻击
		int attech = rand.nextInt(10);
		// 怪物的血量减少
		m.blood -= attech;
		System.out.println("怪物的血量 -" + 
		    attech + ",现有血量:" + m.blood);
	
	}
}
